home *** CD-ROM | disk | FTP | other *** search
- { GMSStickyLabel v1 by Glenn Shukster
-
- GMS COMPUTING INC. Phone (905)771-6458
- 53 COLVIN CRES. Fax -6819
- THORNHILL, ONT. Compuserve: 72734,123
- CANADA L4J 2N7 InternetId:Gms@Shaw.wave.ca
- http://members.tor.shaw.wave.ca/~gms/
-
- This file is the Component Editor for TGMSStickyLabel.
- See header of TGMSStickyLabel for more details.
- }
-
- unit LblEdit;
-
- interface
-
- uses
- {SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
- Forms, Dialogs, StdCtrls, ExtCtrls, Spin, Buttons, DsgnIntf;}
- DsgnIntf, GMSLabel, Dialogs, sysutils, Forms;
-
- type
- TGMSStickyLabelEditor = class( TComponentEditor )
- function GetVerbCount : Integer; override;
- function GetVerb( Index : Integer ) : string; override;
- procedure ExecuteVerb( Index : Integer ); override;
- end;
-
- procedure Register;
-
- implementation
-
- function TGMSStickyLabelEditor.GetVerbCount : Integer;
- begin
- Result := 7;
- end;
-
- function TGMSStickyLabelEditor.GetVerb( Index : Integer ) : string;
- begin
- Case Index Of
- 0 : Result := 'Align GMSStickyLabels';
- 1 : Result := 'Edit Caption';
- 2 : Result := 'Set Gap';
- 3 : Result := 'Left Align';
- 4 : Result := 'Right Align';
- 5 : Result := 'Top Align';
- 6 : Result := 'Bottom Align';
- end;
- end;
-
- procedure TGMSStickyLabelEditor.ExecuteVerb( Index : Integer );
- var
- sGap: String;
- ii : Integer;
- begin
- Case Index Of
- 0 :
- With TGMSStickyLabel(Component).Owner Do
- For ii := 0 to ComponentCount-1 Do
- If Components[ii] is TGMSStickyLabel Then
- TGMSStickyLabel(Components[ii])._ReAlign;
- 1 : TGMSStickyLabel(Component).Caption :=
- InputBox('StickyLabel Caption','Enter Caption',TGMSStickyLabel(Component).Caption);
- 2 :
- begin
- { In Delphi 1 this line was too long so it was split}
- sGap := IntToStr(TGMSStickyLabel(Component)._Gap);
- TGMSStickyLabel(Component)._Gap := StrToInt(InputBox('StickyLabel Gap','Enter Label Gap#',sGap));
- end;
- 3 : TGMSStickyLabel(Component)._AlignTo := TAlignTo(alLeft); { In Delphi 1 & 3 alLeft alone works}
- 4 : TGMSStickyLabel(Component)._AlignTo := TAlignTo(alRight);
- 5 : TGMSStickyLabel(Component)._AlignTo := TAlignTo(alTop);
- 6 : TGMSStickyLabel(Component)._AlignTo := TAlignTo(alBottom);
- end;
- end;
-
- procedure Register;
- begin
- RegisterComponentEditor( TGMSStickyLabel, TGMSStickyLabelEditor );
- end;
-
-
- end.
-